package c.e.a.b.e.c;

import c.e.a.b.b.j.d;
import java.io.IOException;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Locale;

/* compiled from: com.google.android.gms:play-services-measurement-base@@18.0.0 */
public abstract class t3 implements Serializable, Iterable<Byte> {
    public static final t3 b = new z3(w4.b);
    public static final x3 c = (q3.a() ? new b4(null) : new w3(null));
    public int a = 0;

    public static t3 f(byte[] bArr, int i, int i2) {
        j(i, i + i2, bArr.length);
        return new z3(c.a(bArr, i, i2));
    }

    public static int j(int i, int i2, int i3) {
        int i4 = i2 - i;
        if ((((i | i2) | i4) | (i3 - i2)) >= 0) {
            return i4;
        }
        StringBuilder stringBuilder;
        if (i < 0) {
            StringBuilder stringBuilder2 = new StringBuilder(32);
            stringBuilder2.append("Beginning index: ");
            stringBuilder2.append(i);
            stringBuilder2.append(" < 0");
            throw new IndexOutOfBoundsException(stringBuilder2.toString());
        } else if (i2 < i) {
            stringBuilder = new StringBuilder(66);
            stringBuilder.append("Beginning index larger than ending index: ");
            stringBuilder.append(i);
            stringBuilder.append(", ");
            stringBuilder.append(i2);
            throw new IndexOutOfBoundsException(stringBuilder.toString());
        } else {
            stringBuilder = new StringBuilder(37);
            stringBuilder.append("End index: ");
            stringBuilder.append(i2);
            stringBuilder.append(" >= ");
            stringBuilder.append(i3);
            throw new IndexOutOfBoundsException(stringBuilder.toString());
        }
    }

    public abstract byte b(int i);

    public abstract int c();

    public abstract int d(int i, int i2, int i3);

    public abstract t3 e(int i, int i2);

    public abstract boolean equals(Object obj);

    public abstract String g(Charset charset);

    public abstract void h(u3 u3Var) throws IOException;

    public final int hashCode() {
        int i = this.a;
        if (i == 0) {
            i = c();
            i = d(i, 0, i);
            if (i == 0) {
                i = 1;
            }
            this.a = i;
        }
        return i;
    }

    public abstract byte i(int i);

    public /* synthetic */ Iterator iterator() {
        return new v3(this);
    }

    public abstract boolean k();

    public final String toString() {
        Locale locale = Locale.ROOT;
        Object[] objArr = new Object[3];
        objArr[0] = Integer.toHexString(System.identityHashCode(this));
        objArr[1] = Integer.valueOf(c());
        objArr[2] = c() <= 50 ? d.v(this) : String.valueOf(d.v(e(0, 47))).concat("...");
        return String.format(locale, "<ByteString@%s size=%d contents=\"%s\">", objArr);
    }
}
